home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 April / EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso / EARCD / biz / dbase / tm_dbms22.lha / dbmsv2.2 / arexx / DB_KonsolidujBazë.rexx < prev    next >
OS/2 REXX Batch file  |  1996-10-18  |  2KB  |  2 lines

  1. /* Optimized with RexxOpt 1.8 */
  2. _all=0;i=0;OPTIONS RESULTS;lan='Sys:Prefs/DBMS_PLT.prefs';k=0;s=OPEN('Prefs','Sys:Prefs/DBMS.prefs','r');DO FOREVER;w=READLN('Prefs');IF LEFT(w,1)=';' THEN LEAVE;END;DO FOREVER;w=READLN('Prefs');IF w=''|EOF('Prefs') THEN LEAVE;IF LEFT(w,8)='ENGLI = '&RIGHT(w,1)='1' THEN lan='Sys:Prefs/DBMS_ENT.prefs';END;s=OPEN('lan',lan,'r');DO UNTIL EOF('lan');k=k+1;t.k=READLN('lan');END;s=CLOSE('lan');DO FOREVER;w=READLN('Prefs');IF LEFT(w,1)=';' THEN LEAVE;END;DO m=1 TO 5 BY 1;w=READLN('Prefs');IF w=''|EOF('Prefs') THEN LEAVE;IF LEFT(w,8)='FCHNG = ' THEN;DO;CALL Obetnij;field_changed=res;END;IF LEFT(w,8)='CHNG1 = ' THEN;DO;CALL Obetnij;string_to_change=res;END;IF LEFT(w,8)='CHNG2 = ' THEN;DO;CALL Obetnij;string_to_change1=res;END;IF LEFT(w,8)='CHNG3 = ' THEN;DO;CALL Obetnij;string_to_change2=res;END;IF LEFT(w,8)='CHNGT = ' THEN;DO;CALL Obetnij;string_change_for=res;END;END;_linia1=READLN('Prefs');_linia1=COMPRESS(_linia1);FIRST RECORD;FIRSTFIELD;IF _linia1 ~='ALL' THEN;DO;DO FOREVER;f=READLN('Prefs');IF f=''|EOF('Prefs') THEN LEAVE;prefs.i=f;i=i+1;END;END;s=CLOSE('Prefs');i=i-1;DO UNTIL RC>0;IF _linia1='ALL' THEN CALL _All;IF _linia1 ~='ALL' THEN CALL _NotAll;END;SORT;EXIT;_All:;CALL Change_String;FIRSTFIELD;DO UNTIL RC>0;GETFIELD;PUTFIELD COMPRESS(result);NEXTFIELD;END;NEXTRECORD;RETURN;_NotAll:;CALL Change_String;DO j=0 TO i BY 1;CURRENTFIELD prefs.j;GETFIELD;PUTFIELD COMPRESS(result);END;NEXTRECORD;RETURN;Obetnij:;ln=LENGTH(w);ob=ln-8;res=RIGHT(w,ob);RETURN;Change_String:;CURRENTFIELD field_changed;GETFIELD;field=result;poz=POS(string_to_change,field);poz1=POS(string_to_change1,field);poz2=POS(string_to_change2,field);len=LENGTH(string_to_change);len1=LENGTH(string_to_change1);len2=LENGTH(string_to_change2);p=poz;l=len;CALL Sprawdz;p=poz1;l=len1;CALL Sprawdz;p=poz2;l=len2;CALL Sprawdz;RETURN;Sprawdz:;IF p ~=0 THEN;DO;field= DELSTR(field,poz,len);PUTFIELD field||string_change_for;END;RETURN